local function gen_username()
    local ret = "Signature|%s|%s"
    return string.format(ret, ACCESS_KEY,  INSTANCE_ID)
end

local function gen_pwd()
    local hmac_obj = crypto.new_hmac("SHA1", SECRET_KEY)
    hmac_obj:update(CLIENT_ID)
    local digest = hmac_obj:finalize()
    return (encoder.toBase64(digest))
end

return {
	gen_username = gen_username, 
	gen_pwd = gen_pwd
}